import React, { Component } from 'react';
import { NavigationEvents } from 'react-navigation';
import {
	StyleSheet, Text, View, TouchableOpacity,
	Image, PixelRatio, FlatList, Alert
} from "react-native";
import { API, API_GENERATE } from '../../../../config/api';
import { PageStatusIndex } from '../../../../component/page-status/PageStatusIndex';
import { GLOBAL } from '../../../../config/global';
import StorageHelper from '../../../../utils/storageHelper';
import { STORAGE_CONSTANT } from '../../../../config/storage';
import { style } from '../../../../theme/style';
import HTTP from '../../../../utils/http';
import ToastUtil from '../../../../utils/toast';
import { Common } from '../../../../component/common/Common';
import { NewAccount } from '../../../../components/common/newAccount';
import { SlideSelect } from '../../../../components/common/slideSelect';
import { ProgressModal } from '../../../../components/common/ProgressModal';
import { MDMCodeCpt } from "../../highSeas/_components/MDMCodeCpt";

const scale = GLOBAL.SCALE;
const arrowIcon = require('../../../../imgs/sanjiao3.png')

const LIST = [
	{
		key: 'WAIT',
		label: '审批中',
		children: [
			{
				label: '企业创建',
				params: {
					applyType: 'ADD',
					status: 'WAIT',
				}
			},
			{
				label: '企业变更',
				params: {
					applyType: 'CHANGE',
					status: 'WAIT',
				}
			},
			{
				label: '产品认领',
				params: {
					applyType: 'APPLYP',
					status: 'WAIT',
				}
			},
			{
				label: '产品分配',
				params: {
					applyType: 'TRANS',
					status: 'WAIT',
				}
			},
			{
				label: '企业授信',
				params: {
					applyType: 'CREDIT',
					status: 'WAIT',
				}
			},
		]
	},
	{
		key: 'UNPASS',
		label: '审批驳回',
		children: [
			{
				label: '企业创建',
				params: {
					applyType: 'ADD',
					status: 'UNPASS',
				}
			},
			{
				label: '企业变更',
				params: {
					applyType: 'CHANGE',
					status: 'UNPASS',
				}
			},
			{
				label: '产品认领',
				params: {
					applyType: 'APPLYP',
					status: 'UNPASS',
				}
			},
			{
				label: '产品分配',
				params: {
					applyType: 'TRANS',
					status: 'UNPASS',
				}
			}
		]
	},
]

export class EnterpriseApprovalPage extends Component {
	static navigationOptions = ({ navigation, navigationOptions }) => {
		return {
			headerTitle: '企业审批业务',
			headerTintColor: style.color.white,
			headerLeft: <Common type="headLeft" onPress={() => { navigation.goBack() }} color='#fff' />,
			headerRight: (<Image style={{ marginLeft: 18 * scale, width: 9 * scale, height: 16 * scale }} source={require('../../../../imgs/goBackEmpty.png')} />),
			headerStyle: style.head.headerStyle,
			headerTitleStyle: {
				flex: 1,
				textAlign: 'center',
			}
		}
	};

	constructor(props) {
		super(props);
		const { choice } = this.props.navigation.state.params || {};
		this.state = {
			tabIndex: 0,
			tabItem: 0,
			status: 'data',
			refreshIcon: false,
			listData: [],
			resTableList: {},
			rescntList: [],
			resAuditcntList: [],
			params: {
				applyType: 'ADD',
				status: 'WAIT',
			},
			isTablet: true,
			cntList: true,
			isDataItem: true,
			itemAuditingletedCnt: '0',
			itemAuditRejectCntCnt: '0',
			totalPage: '0',
			alertShow: false,
			options: [],
			choice: choice || {},
			lightBoxData: {
				modalVisible: false,
				onClosePress: this._closeLightBox,
				title: '',
				rowDataList: [],
				status: 'data',
				refreshIcon: false,
			}
		}
		this.reload = true; // 判断是整个页面刷新还是下拉刷新
		this.totalPage = 1;
		this.pageParams = {
			pageNo: 1,
			pageSize: 10,
		}
	}

	async componentDidMount () {
		await this.init();
		await this.initPage();
	}

	async componentWillMount () {
		await this.getSorage();
	}

	//获取业务组织
	async getSorage () {
		const userInfoJson = await StorageHelper.get(STORAGE_CONSTANT.USER_INFO_KEY);
		const userInfo = JSON.parse(userInfoJson);
		console.log('userInfo.corpInfoTO', userInfo.corpInfoTO)
		this.setState({
			options: userInfo.corpInfoTOs || [],
			choice: this.state.choice.corpId ? this.state.choice : userInfo.corpInfoTOs[0]
		})
	}

	//初始化数据
	init = async () => {
		let resTableList = await HTTP.GET(API_GENERATE(API.GET_AUDIT_CNT), { corpId: this.state.choice.corpId })
		if (resTableList) {
			let rescntList = resTableList.auditingCnt.cntList
			let resAuditcntList = resTableList.auditRejectCnt.cntList
			let resAuditingletedCnt = resTableList.auditingCnt.incompletedCnt
			let resAuditRejectCntCnt = resTableList.auditRejectCnt.incompletedCnt
			this.setState({
				rescntList,
				resTableList,
				resAuditcntList,
				itemAuditingletedCnt: resAuditingletedCnt,
				itemAuditRejectCntCnt: resAuditRejectCntCnt
			})
		} else {
			this.setState({
				status: 'error'
			})
		}
	}

	initPage = async (refreshIcon) => {
		this.setState({
			status: this.reload ? 'loading' : 'data',
			refreshIcon: !this.reload && this.pageParams.pageNo == '1'
		})
		this.params = {
			pageNo: this.pageParams.pageNo,
			pageSize: this.pageParams.pageSize,
			applyType: this.state.params.applyType,
			status: this.state.params.status,
			corpId: this.state.choice.corpId
		}
		let res = await HTTP.POST(API_GENERATE(API.GET_AUDIT_LIST), this.params)
		if (res) {
			// this.totalPage = res.totalPage;
			let responseData = res.rows;
			this.setState({
				listData: this.pageParams.pageNo == '1' ? responseData : this.state.listData.concat(responseData),
				status: responseData.length > 0 ? 'data' : 'empty',
				refreshIcon: false,
				totalPage: res.totalPage,
			})
			this.pageParams.pageNo = res.pageNo++;
		} else {
			this.setState({
				status: 'error'
			})
		}
	}

	loadMore = () => {
		if (this.state.totalPage > this.pageParams.pageNo) {
			this.pageParams.pageNo++;
			this.reload = false;
			this.initPage();
		}
	}

	refresh = () => {
		this.pageParams.pageNo = 1;
		if (this.state.totalPage >= this.pageParams.pageNo) {
			this.reload = false;
			this.initPage();
		}
	}


	_tabFn = (items, tabIndex) => {
		this.setState({
			tabIndex,
			params: {
				applyType: this.state.tabItem != 4 ? this.state.params.applyType : 'ADD',
				status: items.key
			},
			tabItem: this.state.tabItem != 4 ? this.state.tabItem : 0,
			totalPage: '0',
		}, () => {
			this.pageParams.pageNo = 1;
			this.totalPage = 0;
			this.initPage();
		})
	}


	_tabList = (items, tabItem) => {
		this.reload = true;
		this.pageParams.pageNo = 1;
		this.setState({
			tabItem,
			params: {
				applyType: items.params.applyType,
				status: items.params.status
			},
			totalPage: '0',
		}, () => {
			this.pageParams.pageNo = 1;
			// this.totalPage = 0;
			this.initPage();
		})

	}

	onErrorRefresh = () => {
		let { tabIndex } = this.state;
		if (tabIndex != 2) {
			this.initPage();
		}
	}

	_getCheckApprove = async (data, index) => {
		let { listData } = this.state;
		//查询审批节点AUDIT_QUERY_COMPANY
		let params = {
			bizId: data.applyId,
			bizObjType: 'COMPANY_INFO_AUDIT',
			processInstanceId: data.processInstanceId,
		}
		let responseData1 = []
		if (index == 0 || index == 1) {
			responseData1 = await HTTP.GET(API_GENERATE(API.AUDIT_QUERY_COMPANY), params)
		}
		else if (index == 2 || index == 3) {
			responseData1 = await HTTP.GET(API_GENERATE(API.AUDIT_QUERY_LOG), { applyId: data.applyId })
		}
		responseData1 = responseData1 && responseData1.map((item) => {
			if (item.auditResult == 9) {
				item.auditResultName = '操作';
			}
			return item;
		})
		let { lightBoxData } = this.state;
		lightBoxData.modalVisible = true;
		lightBoxData.title = '审批流';
		lightBoxData.rowDataList = responseData1;
		this.setState({
			lightBoxData,
			status: 'data'
		})


	}

	_closeLightBox = () => {
		let { lightBoxData } = this.state;
		lightBoxData.modalVisible = false;
		this.setState({ lightBoxData });
	}

	goSkipPage = (item) => {
		let { tabItem, tabIndex, choice } = this.state;
		if (tabItem == 0) {
			tabIndex == 0 ? this.props.navigation.navigate('EnterpriseDetailsPage', {
				tabIndex: 0,
				companyId: item.companyId,
				id: item.applyId,
				title: item.companyName,
				status: 0,
				choice
			}) :
				this.props.navigation.navigate('EnterpriseCreateBaseInfo', {
					tabIndex: 0,
					companyId: item.companyId,
					id: item.applyId,
					title: item.companyName,
					status: 0,
					choice
				})
		} else if (tabItem == 1) {
			this.props.navigation.navigate('EnterpriseChangePage', {
				applyId: item.applyId,
				choice
			})
		} else if (tabItem == 2) {
			this.props.navigation.navigate('ProductClaimPage', {
				applyId: item.applyId,
				title: '认领',
				isJudge: false,
				choice
			})
		} else if (tabItem == 3) {

			this.props.navigation.navigate('ProductClaimPage', {
				applyId: item.applyId,
				title: '分配',
				isJudge: false,
				choice
			})
		}
		else if (tabItem == 4) {
			this.props.navigation.navigate('EnterpriseDetailsPage', {
				tabIndex: 1,
				companyId: item.companyId,
				id: item.applyId,
				title: item.companyName,
				status: 1,
				currentCreditType: item.taskName == '赊销' ? 2 : 1,
				creditApplyStatus: '2X',
				choice
			})
		}
	}
	// 删
	itemDelete = (applyId, applyType) => {
		Alert.alert('提示', '确认删除这条记录？', [
			{ text: '取消' },
			{
				text: '确定', onPress: async () => {
					const response = await HTTP.POST(API_GENERATE(API.DEL_COMPANY_APPLY), { applyId, applyType });
					if (response) {
						ToastUtil.showSuccess('删除成功').then(() => {
							this.init();
							this.initPage();
						})
					}
				}
			},
		]);
	}
	_approvalListItim = (data) => {
		let { tabItem, tabIndex } = this.state
		let item = data.item;
		return (
			<View style={{
				marginTop: 20 * scale, paddingLeft: 12 * scale,
				paddingRight: 12 * scale,
			}}>
				<View style={{ marginBottom: 7 * scale, flexDirection: 'row', justifyContent: 'flex-end' }}>
					<Text style={styles.itemLightText}>{item.createDate || '--'}</Text>
				</View>
				<TouchableOpacity activeOpacity={.6} style={styles.itemWrap}
					onPress={() => {
						this.goSkipPage(item)
					}}
				>

					{tabIndex == 0 ? (
						<View style={{ flexDirection: 'row', marginBottom: 15 * scale, marginTop: 5 * scale, paddingLeft: 12 * scale, paddingRight: 12 * scale, alignItems: 'center' }}>
							<View style={{ flex: 5, flexDirection: 'row', alignItems: 'center' }}>
								{!item.mdmCode && tabItem == 2 ? <MDMCodeCpt /> : null}
								<Text style={styles.itemLightText}>{item.companyName || '--'}</Text>
							</View>
							<View style={{ marginBottom: 1 * scale }}>
								{tabItem !== 4 ?
									<TouchableOpacity style={styles.itemLightColor} onPress={() => { this._getCheckApprove(item, tabItem) }}>
										<Text style={styles.itemLightColorText}>
											{tabItem == 0 ? '企业创建' : tabItem == 1 ? item.applyType == 'CONVERT' ? '转外贸' : '企业变更' : tabItem == 2 ? '产品认领' : tabItem == 3 ? '产品分配' : ''}
										</Text>
									</TouchableOpacity> :
									<Text style={styles.itemLightBox}>
										授信申请
								</Text>
								}
							</View>
						</View>
					) : (
							<View style={{ flexDirection: 'row', marginBottom: 15 * scale, marginTop: 5 * scale, paddingLeft: 12 * scale, paddingRight: 12 * scale, alignItems: 'center' }}>
								<View style={{ flex: 3.5, flexDirection: 'row', alignItems: 'center' }}>
									{/* <Text style={styles.itemLightText}>{item.companyName || '--'}</Text> */}
									{!item.mdmCode && tabItem == 2 ? <MDMCodeCpt /> : null}
									<Text style={styles.itemLightText}>
										{
											item.companyName ? (
												item.companyName.length > 8 ? (item.companyName.substr(0, 9) + '...') : item.companyName
											) : '--'
										}
									</Text>
								</View>
								<View style={{ flex: 2 }}>
									<Text style={styles.itemCause} onPress={() => { Alert.alert(item.remark || '无') }}>【驳回原因】</Text>
								</View>
								<View style={{ flex: 0.5 }}>
									<Text style={styles.itemCause} onPress={() => { this.itemDelete(item.applyId, item.applyType) }}>删</Text>
								</View>
								<TouchableOpacity style={styles.itemLightColor} onPress={() => { this._getCheckApprove(item, tabItem) }}>
									<Text style={styles.itemLightColorText}>{tabItem == 0 ? '企业创建' : tabItem == 1 ? item.applyType == 'CONVERT' ? '转外贸' : '企业变更' : tabItem == 2 ? '产品认领' : tabItem == 3 ? '产品分配' : ''}</Text>
								</TouchableOpacity>
							</View>
						)

					}
					<View style={styles.itemBorder}></View>
					{tabItem != 4 ? (tabItem == 0 || tabItem == 1 ? (
						<View>
							{/* {'评级' && <View style={{ flexDirection: 'row', alignItems: 'center', position: 'relative', paddingRight: 20 * scale, paddingLeft: 12 * scale, paddingRight: 12 * scale, marginBottom: 10 * scale }}>
								<View style={styles.itemType}>
									<Text style={{ color: '#000000', fontSize: 12 * scale, fontWeight: '300' }}>企业升级</Text>
								</View>
								<Text style={{ color: '#000000', fontSize: 12 * scale, fontWeight: '600' }}>{'升2级'}</Text>
							</View>} */}
							<View style={{ flexDirection: 'row', position: 'relative', paddingRight: 20 * scale, paddingLeft: 12 * scale, paddingRight: 12 * scale, }}>
								<View style={styles.itemType}>
									<Text style={{ color: '#000000', fontSize: 12 * scale, fontWeight: '300' }}>操作人</Text>
								</View>
								<Text style={{ color: '#000000', fontSize: 12 * scale, fontWeight: '600', flexDirection: 'row', width: 212 * scale }}>
									{item.staffName || item.bizTeamName ? `${item.staffName || '--'} | ${item.bizTeamName || '--'}` : '--'}
								</Text>
								<Image source={arrowIcon} style={styles.arrowIcon} />
							</View>
						</View>) : (
							<View>
								{tabItem == 2 ? (
									<View>
										<View style={{ flexDirection: 'row', position: 'relative', paddingRight: 20 * scale, paddingLeft: 12 * scale, paddingRight: 12 * scale, marginBottom: 12 * scale }}>
											<View style={styles.itemProduct}>
												<Text style={{ color: '#000000', fontSize: 12 * scale, fontWeight: '300' }}>本次认领产品数</Text>
											</View>
											<Text style={{ color: '#000000', fontSize: 12 * scale, fontWeight: '600' }}>{item.goodsCnt || '--'}</Text>
										</View>
										<View style={{ flexDirection: 'row', position: 'relative', paddingRight: 20 * scale, paddingLeft: 12 * scale, paddingRight: 12 * scale, marginBottom: 12 * scale }}>
											<View style={styles.itemType}>
												<Text style={{ color: '#000000', fontSize: 12 * scale, fontWeight: '300' }}>操作人</Text>
											</View>
											<Text style={{ color: '#000000', fontSize: 12 * scale, fontWeight: '600', flexDirection: 'row', width: 212 * scale }}>
												{item.createByName || item.bizTeamName ? `${item.createByName || '--'} | ${item.bizTeamName || '--'}` : '--'}
											</Text>
											{/* <Text style={{ color: '#000000', fontSize: 12 * scale, fontWeight: '600', marginLeft: 10 * scale }}>{item.createByOranName ? `(${item.createByOranName})` : ''}</Text> */}
											<Image source={arrowIcon} style={styles.arrowIcon} />
										</View>
									</View>
								) : (
										<View>
											<View style={{ flexDirection: 'row', alignItems: 'center', position: 'relative', paddingRight: 20 * scale, paddingLeft: 12 * scale, paddingRight: 12 * scale, marginBottom: 12 * scale }}>
												<View style={styles.itemProduct}>
													<Text style={{ color: '#000000', fontSize: 12 * scale, fontWeight: '300' }}>本次分配产品数</Text>
												</View>
												<Text style={{ color: '#000000', fontSize: 12 * scale, fontWeight: '600' }}>{item.goodsCnt || '--'}</Text>
											</View>
											<View style={{ flexDirection: 'row', alignItems: 'center', position: 'relative', paddingRight: 20 * scale, paddingLeft: 12 * scale, paddingRight: 12 * scale, marginBottom: 12 * scale }}>
												<View style={styles.itemType}>
													<Text style={{ color: '#000000', fontSize: 12 * scale, fontWeight: '300' }}>接收人</Text>
												</View>
												<Text style={{ color: '#000000', fontSize: 12 * scale, fontWeight: '600' }}>{item.bizStaffName || '--'}</Text>
												<Text style={{ color: '#000000', fontSize: 12 * scale, fontWeight: '600', marginLeft: 10 * scale }}>{item.bizStaffOranName ? `(${item.bizStaffOranName})` : ''}</Text>
											</View>
											<View style={{ flexDirection: 'row', position: 'relative', paddingRight: 20 * scale, paddingLeft: 12 * scale, paddingRight: 12 * scale, paddingBottom: 5 * scale }}>
												<View style={styles.itemType}>
													<Text style={{ color: '#000000', fontSize: 12 * scale, fontWeight: '300' }}>操作人</Text>
												</View>
												<Text style={{ color: '#000000', fontSize: 12 * scale, fontWeight: '600', flexDirection: 'row', width: 212 * scale }}>
													{item.createByName || item.bizTeamName ? `${item.createByName || '--'} | ${item.bizTeamName || '--'}` : '--'}
												</Text>
												<Image source={arrowIcon} style={styles.arrowIcon} />
											</View>
										</View>
									)
								}

							</View>)
					) : (
							<View style={{ marginBottom: 15 * scale, marginTop: 10 * scale, paddingLeft: 12 * scale, paddingRight: 12 * scale, }}>
								<View style={{ flexDirection: 'row', alignItems: 'center', position: 'relative', }}>
									<View style={{ flex: 2 }}>
										<Text style={styles.itemAccount}>预付账户</Text>
									</View>
									<View style={{ flex: 0 }}>
										<Text style={styles.itemApplyAmount}>¥{item.applyAmount || 0}.00元</Text>
									</View>
								</View>
								<View style={styles.itemDayTime}>
									<Text style={styles.itemTime}>账期: {item.accountDay || '--'}天 | 有效期至{item.creditEndDate || '--'} </Text>
								</View>
							</View>
						)
					}
				</TouchableOpacity>
			</View>
		)
	}


	render () {
		let { tabIndex, listData, tabItem, refreshIcon, status, rescntList, itemAuditRejectCntCnt, itemAuditingletedCnt,
			resAuditcntList, alertShow, choice, options, lightBoxData } = this.state;
		return (
			<View style={styles.container}>
				<NavigationEvents onWillFocus={async () => {
					await this.getSorage();
					await this.init();
					await this.initPage();
				}} />
				{options.length > 1 ? <NewAccount fn={(val) => { this.setState({ alertShow: val }) }} choice={choice.corpName || ''} /> : null}
				<View style={styles.headBox}>
					{LIST.map((items, index) => {
						return (
							<Text key={index} onPress={() => { this._tabFn(items, index) }} style={[styles.tabItems, tabIndex == index ? styles.tabItemActive : null]}>{items.label} {index == 0 ? itemAuditingletedCnt : itemAuditRejectCntCnt}</Text>)
					})
					}
				</View>
				<View style={[styles.stateView, styles.marginStyle]}>
					{tabIndex == 0 ? (
						LIST[0].children.map((items, index) => {
							return (
								<TouchableOpacity key={index} style={[styles.stateItem, tabItem == index ? styles.stateItemActive : null]} onPress={() => { this._tabList(items, index) }}>
									<Text style={[styles.stateItemText, tabItem == index ? styles.stateItemTextActive : null]}>{items.label}</Text>
									<View style={[rescntList[index] && rescntList[index].incompletedCnt > 0 ? styles.stateItemInfo : null, , tabItem == index ? styles.stateItemInfoActive : null]}></View>
								</TouchableOpacity>
							)
						})
					) : (LIST[1].children.map((items, index) => {
						return (
							<TouchableOpacity key={index} style={[styles.stateItem, tabItem == index ? styles.stateItemActive : null]} onPress={() => { this._tabList(items, index) }}>
								<Text style={[styles.stateItemText, tabItem == index ? styles.stateItemTextActive : null]}>{items.label}</Text>
								<View style={[resAuditcntList[index] && resAuditcntList[index].incompletedCnt > 0 ? styles.stateItemInfo : null, tabItem == index ? styles.stateItemInfoActive : null]}></View>
							</TouchableOpacity>
						)
					}))
					}
				</View>
				{
					status == 'data' ? (
						tabIndex == 0 ? (
							(
								<View style={styles.body}>
									<FlatList
										data={listData}
										renderItem={
											this._approvalListItim
										}
										refreshing={refreshIcon}
										onRefresh={() => { this.refresh() }}
										onEndReachedThreshold={1}
										onEndReached={() => { this.loadMore() }}
									/>
								</View>
							)
						) : (
								<View style={styles.body}>
									<FlatList
										data={listData}
										renderItem={
											this._approvalListItim
										}
										refreshing={refreshIcon}
										onRefresh={() => { this.refresh() }}
										onEndReachedThreshold={1}
										onEndReached={() => { this.loadMore() }}
									/>
								</View>
							)
					) : (<View style={{ flex: 1 }}>
						<PageStatusIndex status={status} emptyText="暂无记录" onErrorPress={this.onErrorRefresh} />
					</View>)
				}

				<SlideSelect alertShow={alertShow} options={options}
					select={(val) => {
						this.setState({ choice: val || options[0], alertShow: false }, async () => {
							this.pageParams.pageNo = 1;
							this.totalPage = 0;
							await this.init();
							await this.initPage();
						})
					}}
					unselect={() => {
						this.setState({ alertShow: false })
					}} />
				<ProgressModal {...lightBoxData} />
			</View>
		)
	}
}
const styles = StyleSheet.create({
	container: {
		flex: 1,
		backgroundColor: style.color.bgGray
	},
	headBox: {
		backgroundColor: style.color.themeColor,
		height: 50 * scale,
		width: '100%',
		flexDirection: 'row',
		justifyContent: 'space-around'
	},
	tabItems: {
		color: style.color.white,
		fontSize: 14 * scale,
		width: '35%',
		textAlign: 'center',
		marginTop: 20 * scale,
		opacity: .8
	},
	marginStyle: {
		marginLeft: 20 * scale,
		// marginRight: 16 * scale
	},
	tabItemActive: {
		opacity: 1
	},
	stateView: {
		flexDirection: 'row',
		marginTop: 15 * scale,
		// marginBottom: 15 * scale,
		flexWrap: 'wrap'
	},
	stateItem: {
		padding: 8 * scale,
		borderWidth: 1 * scale,
		borderStyle: 'solid',
		// marginTop: 15 * scale,
		marginBottom: 15 * scale,
		borderColor: style.color.themeColor,
		borderRadius: 20 * scale,
		marginRight: 10 * scale,
		flexDirection: 'row'
	},
	stateItemText: {
		paddingRight: 4 * scale,
		paddingLeft: 4 * scale,
		fontSize: 11 * scale,
		color: style.color.themeColor
	},
	stateItemInfo: {
		width: 6 * scale,
		height: 6 * scale,
		backgroundColor: style.color.fontRed1,
		borderRadius: 3 * scale,
		position: 'relative',
		top: -5 * scale
	},
	stateItemActive: {
		backgroundColor: style.color.themeColor,
	},
	stateActive: {
		backgroundColor: style.color.white,
	},
	stateItemTextActive: {
		fontSize: 11 * scale,
		color: style.color.white
	},
	stateItemInfoActive: {
		backgroundColor: style.color.white
	},
	body: {
		flex: 1,
		backgroundColor: style.color.bgGray,
	},
	itemLightText: {
		fontSize: 12 * scale,
		color: '#272727',
	},
	itemCause: {
		fontSize: 12 * scale,
		color: '#0091FF',
	},
	itemAccount: {
		fontSize: 12 * scale,
		color: '#272727',
	},
	itemDayTime: {
		justifyContent: 'flex-end',
		flex: 1,
		flexDirection: 'row'
	},
	itemTime: {
		fontSize: 12 * scale,
		color: '#272727',
		opacity: .8,
		paddingTop: 10 * scale,
		paddingRight: 10 * scale,
		// paddingRight:12 *scale,
		// justifyContent:'flex-end',
		// flex:1,
		// flexDirection:'row'
	},
	itemWrap: {
		backgroundColor: '#fff',
		width: '100%',
		borderRadius: 8 * scale,
		// paddingLeft: 12 * scale,
		// paddingRight: 12 * scale,
		paddingBottom: 18 * scale,
		paddingTop: 14 * scale,
	},
	itemProduct: {
		// height: 20 * scale,
		width: 88 * scale,
		flexDirection: 'row',
		alignItems: 'flex-start',
		// justifyContent: 'center',
		// flex: 4,
		// backgroundColor: '#FA9B22',
		borderRadius: 4 * scale,
		marginRight: 10 * scale,
	},
	itemType: {
		// height: 20 * scale,
		width: 58 * scale,
		paddingTop: 2 * scale,
		flexDirection: 'row',
		alignItems: 'flex-start',
		// justifyContent: 'center',
		// flex: 4,
		// backgroundColor: '#FA9B22',
		borderRadius: 4 * scale,
		marginRight: 10 * scale,
	},
	itemLightColor: {
		justifyContent: 'flex-end',
		marginRight: 18 * scale,
		borderColor: '#0E7FFD',
		borderWidth: 1 * scale,
		borderRadius: 9.3 * scale
	},
	itemLightColorText: {
		fontSize: 12 * scale,
		color: '#0E7FFD',
		paddingVertical: 3 * scale,
		paddingHorizontal: 7 * scale
	},
	itemLightBox: {
		justifyContent: 'flex-end',
		fontSize: 12 * scale,
		color: '#F60202',
		marginRight: 18 * scale,
	},
	itemBorder: {
		height: 1 * scale,
		backgroundColor: '#E3E7F0',
		marginBottom: 12 * scale,
	},
	arrowIcon: {
		width: 8 * scale,
		height: 12 * scale,
		position: 'absolute',
		right: 0,
		top: 2 * scale,
		right: 32 * scale,
	},
	itemApplyAmount: {
		flexDirection: 'row',
		alignItems: 'flex-end',
		paddingRight: 10 * scale,
	},
})